using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class StorageTableMap : EntityTypeConfiguration<StorageTable>
    {
        public StorageTableMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            //// Properties
            //this.Property(t => t.Number)
            //    .HasMaxLength(64);

            //this.Property(t => t.Format)
            //    .HasMaxLength(64);

            this.Property(t => t.OrderNumber)
                .HasMaxLength(64);

            this.Property(t => t.CreatorName)
                .HasMaxLength(64);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("StorageTable");
            this.Property(t => t.Id).HasColumnName("Id");
            //this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Type).HasColumnName("Type");
            //this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.StorageId).HasColumnName("StorageId");
            //this.Property(t => t.OrderId).HasColumnName("OrderId");
            this.Property(t => t.OtherType).HasColumnName("OtherType");
            //this.Property(t => t.OtherId).HasColumnName("OtherId");
            this.Property(t => t.ProductId).HasColumnName("ProductId");
            //this.Property(t => t.Format).HasColumnName("Format");
            //this.Property(t => t.Unit).HasColumnName("Unit");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.CreatorId).HasColumnName("CreatorId");
            this.Property(t => t.CreatorName).HasColumnName("CreatorName");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.Time).HasColumnName("Time");
            //this.Property(t => t.ApplyId).HasColumnName("ApplyId");
            this.Property(t => t.Memo).HasColumnName("Memo");
            this.Property(t => t.OrderNumber).HasColumnName("OrderNumber");
            //this.Property(t => t.InvoiceID).HasColumnName("InvoiceID");
            
        }
    }
}
